package com.itheima.goods.search.controller;

import com.itheima.goods.search.service.SearchServiceMy;
import org.elasticsearch.search.SearchService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@RestController
@RequestMapping("/search")
@CrossOrigin("*") // 处理跨域问题
public class SearchController {
    @Autowired
    private SearchServiceMy searchServiceMy;
    @PostMapping
    public Map search(@RequestBody Map searchMap) throws Exception {
        Map resultMap = searchServiceMy.search(searchMap);
        return resultMap;
    }
}